package org.xserver.component.exception;

import org.jboss.netty.handler.codec.http.HttpResponseStatus;

public class AbstractBussinessException extends Exception {

	private static final long serialVersionUID = 1L;
	private HttpResponseStatus status;

	private String code;

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public AbstractBussinessException() {
	}

	public AbstractBussinessException(String code, String message){
		super(message);
		this.code = code;
	}

	public AbstractBussinessException(String message, Throwable throwable){
		super(message, throwable);
	}

	public AbstractBussinessException(Throwable throwable){
		super(throwable);
	}

	public AbstractBussinessException(String message) {
		super(message);
	}

	public AbstractBussinessException(HttpResponseStatus status, String message) {
		this(message);
		this.status = status;
	}

	@Override
	public String toString() {
		return getMessage();
	}

	public HttpResponseStatus getStatus() {
		return status;
	}
}
